package com.hex.liyue.lookingdatemodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.lookingdatemodule.bean.HotNewResultBean;

/**
 * Created by WJ on 2016/6/17.
 */
public class HotNewPresenter {
    private IHotNewView iHotNewsView;

    public HotNewPresenter(IHotNewView iHotNewsView) {
        this.iHotNewsView = iHotNewsView;
    }

    public void searchAppointment(int sex, String type, int page, int pagenum) {
        HttpManager.getInstance().searchAppointment(
                UserManager.getUserId(),
                sex,
                type,
                page,
                pagenum,
                new ResponseListener<HotNewResultBean>() {
                    @Override
                    public void onSuccess(HotNewResultBean hotNewResultBean) {
                        iHotNewsView.setAdapter(hotNewResultBean);
                    }

                    @Override
                    public void onFailure(String responseresult) {
                        iHotNewsView.showT(responseresult);
                    }
                }
        );

    }
}
